package collector

import "github.com/prometheus/client_golang/prometheus"

func (c *Collector) registerConstMetricGauge(ch chan<- prometheus.Metric, metric string, val float64, labels ...string) {
	c.registerConstMetric(ch, metric, prometheus.GaugeValue, val, labels...)
}

func (c *Collector) registerConstMetric(ch chan<- prometheus.Metric, metric string, valType prometheus.ValueType, val float64, labelValues ...string) {
	descr := c.metricDescriptions[metric]
	if descr == nil {
		descr = newMetricDescr(metric, metric+" metric", labelValues)
	}

	if m, err := prometheus.NewConstMetric(descr, valType, val, labelValues...); err == nil {
		ch <- m
	}
}
